#ifndef _TEXT_QUERY_H
#define _TEXT_QUERY_H

#include <string>
#include <vector>
#include <set>
#include <map>
#include <fstream>

using namespace std;


class TextQuery{
public:
	typedef vector<string>::size_type line_no;

private:
	vector<string> _content;
	// set<int> _lineNumber;
	// map<set<int>, vector<string>> _line;
	map<string, set<line_no>> _wordMap;	

public:	
	void read_file(ifstream& inFileStream)
	{
		store_file(inFileStream);
		build_map();
	}
	set<line_no> run_query(const string &word) const;
	string text_line(const line_no lineNumber) const;

private:
	void store_file(ifstream& inFileStream);
	void build_map();
};

#endif // _TEXT_QUERY_H